$(function(){
				search();
			});
		
			function search(){
				var loginLog = JSON.stringify({
					username:$("#username").val(),
					truename:$("#truename").val(),
					startTime:$("#startTime").val(),
					endTime:$("#endTime").val(),
					pageNum:$("#pageNum").val(),
					pageSize:$("#pageSize").val() 
				});
				$.ajax({
		            url : "loginLog",
		            data : loginLog,
		            type : 'PATCH',
		            dataType : 'json',
		            contentType : 'application/json',
		            success : successFunc,
		            error : errorFunc
			    });
			}
			
			function successFunc(data) {
				if(data != null){
					var list = data.list;
					var innerHtml = "";
					var username = "";
					var truename = "";
					var ip = "";
					var department = "";
					var createtime = "";
					 var num = (data.pageNum-1)*data.pageSize;
					$.each(list, function(i, row){
						createtime = formatJSONDate(row.createtime);
						username = row.username == null?"":row.username;
						truename =  row.truename == null?"":row.truename;
						ip = row.ip == null?"":row.ip;
						department = row.department == null?"":row.department;
						id = row.id;
						innerHtml += "<tr <c:if test='${i%2==0}'> class='odd'</c:if>>" 
										+ "<td algin='center'><span class='entityList'>"+(num+i+1)+"</td>"
										+ "<td algin='center'><span class='entityList'>"+username+"</td>"
										+ "<td algin='center'><span class='entityList'>"+truename+"</td>"
										+ "<td algin='center'><span class='entityList'>"+ip+"</td>"
										+ "<td algin='center'><span class='entityList'>"+department+"</td>"
										+ "<td algin='center'><span class='entityList'>"+createtime+"</td>"
										+ "<td algin='center'><span class='entityList'><a href='javascript:getLogin("+id+")'>查看</a></td>"
										+ "</tr>"
					})
					$("#msg").html(innerHtml);
					
					//加载分页
					pageHelper(data.pageNum,data.lastPage);
				}else{
					alert("获取数据失败！");
				}
		    }
		    function errorFunc(data) {
		    	alert("获取数据失败！");
		    }
		    
		    function getLogin() {
				var url = "loginLog/"+id;
		    	window.location.href=url;
			}